package com.banyuan;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;

public class CopyNetimage {
    public static void main(String[] args) {
        InputStream is  = null;
        OutputStream os = null;
        try {
            URL url = new URL("https://www.baidu.com/s?wd=%E5%A4%A7%E9%99%86%E6%9B%BE%E6%AC%B2%E4%BB%8A%E7%A7%8B%E6%AD%A6%E7%BB%9F%E5%8F%B0%E6%B9%BE%EF%BC%9F%E5%9B%BD%E5%8F%B0%E5%8A%9E%E5%9B%9E%E5%BA%94&sa=fyb_n_homepage&rsv_dl=fyb_n_homepage&from=super&cl=3&tn=baidutop10&fr=top1000&rsv_idx=2&hisfilter=1");;
            is = url.openStream();
            os = new FileOutputStream("/Users/edy/Desktop/file/xinlang.html");
            IOUtilis.copy(is,os);



        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUtilis.closeQuiety(is);
            IOUtilis.closeQuiety(os);
        }


    }
}
